package mytankGame02;

import java.util.Vector;

public class Hero extends tank {
    Vector<Shot> shots = new Vector<>();
    final int MAX_SHOT_NUM = 5;

    public Hero(int x, int y, int direction) {
        super(x, y, direction);
    }


    public void shotEnemy() {
        Shot shot = null;
        switch (getDirection()) {
            case 0:
                shot = new Shot(getX() + 20, getY(), 0);
                break;
            case 1:
                shot = new Shot(getX() + 60, getY() + 20, 1);
                break;
            case 2:
                shot = new Shot(getX() + 20, getY() + 60, 2);
                break;
            case 3:
                shot = new Shot(getX(), getY() + 20, 3);
                break;

        }
        shots.add(shot);
        new Thread(shot).start();
    }

}
